package com.feign;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;

import static org.springframework.http.MediaType.APPLICATION_JSON_VALUE;


@FeignClient(url = "https://open.ys7.com", name = "localRecApiFeign")
public interface YsApiFeign {



    @PostMapping(value = "/api/lapp/token/get", produces = APPLICATION_JSON_VALUE)
    String getToken(@RequestParam("appKey") String  appKey, @RequestParam("appSecret") String  appSecret);


    @PostMapping(value = "/api/lapp/device/encrypt/off", produces = APPLICATION_JSON_VALUE)
    String encryptOff(@RequestParam("accessToken") String  accessToken
            , @RequestParam("deviceSerial") String  deviceSerial
            , @RequestParam("validateCode") String  validateCode);


    @PostMapping(value = "/api/lapp/passengerflow/switch/status", produces = APPLICATION_JSON_VALUE)
    String status(@RequestParam("accessToken") String  accessToken
            , @RequestParam("deviceSerial") String  deviceSerial);


    @PostMapping(value = "/api/lapp/passengerflow/daily", produces = APPLICATION_JSON_VALUE)
    String daily(@RequestParam("accessToken") String  accessToken
            , @RequestParam("deviceSerial") String  deviceSerial
            , @RequestParam("channelNo") int  channelNo
            , @RequestParam("date") long  date
    );


    @PostMapping(value = "/api/lapp/device/capacity", produces = APPLICATION_JSON_VALUE)
    String capacity(@RequestParam("accessToken") String  accessToken
            , @RequestParam("deviceSerial") String  deviceSerial
    );

    @PostMapping(value = "/api/lapp/device/delete", produces = APPLICATION_JSON_VALUE)
    String delete(@RequestParam("accessToken") String  accessToken
            , @RequestParam("deviceSerial") String  deviceSerial
    );


}
